<template>
<!--已发布的团课信息(列表信息)  -->
	<view class="container">

		<u-row v-for="(item, index) in releaseCourseInfo" :key="index" @click="details(item.id)">
			<view class="view01">
				<u--image class="image01" :src="item.coverPic"></u--image>
				<view class="course_name">
					{{item.courseName}}
				</view>
			</view>
			<view class="course_describe">
				{{item.courseDescribe}}
			</view>
		</u-row>
		<!-- <tabbar selected-index=1></tabbar> -->
		<view>
			<u-tabbar>
				<u-tabbar-item text="首页" icon="home" @click="shouye"></u-tabbar-item>
				<u-tabbar-item text="课程" icon="photo"></u-tabbar-item>
				<u-tabbar-item text="我的" icon="account"></u-tabbar-item>
			</u-tabbar>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				releaseCourseInfo: {} //查询结果
			}
		},
		created() {
			// 全查列表
			this.getReleaseCourse()
		},
		methods: {
			//底部导航
			shouye() {
				uni.reLaunch({
					url: '/pages/student/index/index'
				})
			},
			// 跳转到详细页面
			details(id) {
				uni.navigateTo({
					url: '/pages/student/index/classDetails?id=' + id
				})

			},
			// 查询已发布的团课信息(列表信息)
			getReleaseCourse() {
				uni.request({
					url: 'http://127.0.0.1:8080/subscribe/courseSubscribe/queryAll',
					method: 'GET',
					success: (res) => {
						// console.log(res)
						this.releaseCourseInfo = res.data.rows
						console.log(this.releaseCourseInfo)
					}
				})
			},
		}
	}
</script>

<style>
	.course_name {
		position: relative;
		top: -95px;
		left: 140px;
	}

	.course_describe {
		position: relative;
		top: -5px;
		left: 10px;
		font-size: 10px;

	}

	.course_status {
		position: relative;

		left: 204px;
	}

	.button01 {
		height: 40px;
		width: 100px;
		position: relative;
		left: 24px;
	}

	.image01 {
		height: 100px;
	}
</style>
